import { Graph } from "@antv/x6";
import * as FlowGraph from "../../core/create";
import { CustomGraphType } from "../type";
import SKGraph from "./SKGraph.vue";
import { BaseNodeConfigPanel } from "../../shared";
import { PORTS } from "../../default";

Graph.registerNode("SKGraph", {
	inherit: "vue-shape",
	width: 70,
	height: 70,
	component: {
		template: `<SKGraph />`,
		components: { SKGraph }
	},
	ports: PORTS,
	data: {
		type: CustomGraphType.水库,
		vue: true
	}
});

FlowGraph.install(CustomGraphType.水库, ({ graph, appendStencil }) => {
	appendStencil([graph.createNode({ shape: "SKGraph" })]);
	return { configPanel: BaseNodeConfigPanel };
});
